package net.aop.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class MyAspect {
    @Before(value = "execution(* net.aop.dao.impl.*.*(..))")
    public void check_author(){
        System.out.println("校验权限。。");
    }

    public void log(){
        System.out.println("输出日志信息。。。。");
    }

    @Around(value = "execution(* net.aop.dao.impl.CartDaoImplOne.update(..))")
    public void around(ProceedingJoinPoint point) throws Throwable {
        System.out.println("环绕前。。。");
        point.proceed();
        System.out.println("环绕后。。。");
    }
}
